import http from '@/api/request';

// 商品分类
export const getGoodsCategory = () => {
  return http.request({
    method: 'GET',
    url: '/app/goods/category_list',
    params: { status: 1 },
  });
};

// 商品列表（普通）
export const getGoodsList = (page: number, limit: number, categoryId: number) => {
  return http.request({
    method: 'GET',
    url: '/app/goods/list',
    params: { page_size: limit, page: page, goods_category_id: categoryId, status: 1 },
  });
};

// 商品列表（高定）
export const getGoodsListCustom = (key: string) => {
  return http.request({
    method: 'GET',
    url: '/app/goods/list_custom',
    params: { key: key },
  });
};

// 商品列表（分类）
export const getGoodsListCategory = () => {
  return http.request({
    method: 'GET',
    url: '/app/goods/list_category',
  });
};

// 商品详情
export const getGoodsDetail = (query: object) => {
  return http.request({
    method: 'GET',
    url: '/app/goods/detail',
    params: query,
  });
};
